

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Show Schedule</title>
    </head>
    <body>
        <div class="body">
            <h1>Schedule for course: ${scheduleInstance?.course?.encodeAsHTML()}</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="dialog">
                <table>
                    <tbody>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Day:</td>

                            <td valign="top" class="value">${scheduleInstance?.day()}</td>

                        </tr>

                        <tr class="prop">
                            <td valign="top" class="name">Start:</td>

                            <td valign="top" class="value">${scheduleInstance?.startHours()}</td>

                        </tr>

                        <tr class="prop">
                            <td valign="top" class="name">End:</td>
                            
                            <td valign="top" class="value">${scheduleInstance?.endHours()}</td>
                            
                        </tr>

                        <tr class="prop">
                            <td valign="top" class="name">Responsible:</td>

                            <td valign="top" class="value"><g:link controller="employee" action="show" id="${scheduleInstance?.responsible?.id}">${scheduleInstance?.responsible?.encodeAsHTML()}</g:link></td>

                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Location:</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:scheduleInstance, field:'location')}</td>
                            
                        </tr>

                        <tr class="prop">
                            <td valign="top" class="name">Seats:</td>

                            <td valign="top" class="value">${fieldValue(bean:scheduleInstance, field:'seats')}</td>

                        </tr>

                    </tbody>
                </table>
            </div>



            <div class="buttons">
                <g:form>
                    <input type="hidden" name="id" value="${scheduleInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                </g:form>
            </div>


            <g:if test="${session?.container && Container.get(session?.container)?.hasTab('Schedule') || !session?.container}">
        <div class="courseParticipants" style="float:left; width:40%; margin-left:5%;">
          <br/><h2>${Inter.printOut('Participants',session.language)}</h2>
          <table>
            <tbody>
              <tr>
                <th>${Inter.printOut('Name',session.language)}</th>
              </tr>
            <g:each var="e" in="${scheduleInstance.allParticipants()}">
              <tr>
                <td>
              <g:if test="${!e?.isApplicant}">
              <g:link action="show" controller="employee" id="${e?.id}">${e?.firstName} ${e?.lastName}</g:link>
              </g:if>
              <g:else>
                ${e?.firstName} ${e?.lastName}
              </g:else>
              </td>
              </tr>
            </g:each>
            </tbody>
          </table>
          <div class="buttons">
            <g:form>
              <input type="hidden" name="id" value="${scheduleInstance.id}"/>
              <span class="button"><g:actionSubmit class="add_participant" value="${Inter.printOut('Add',session.language)}" action="add_participant" /></span>
              <g:if test="${scheduleInstance.allParticipants().size > 0}">
                <span class="button"><g:actionSubmit class="delete_participant" value="${Inter.printOut('Delete',session.language)}" action="delete_participant" /></span>
              </g:if>
              <span class="button"><g:actionSubmit class="list_participant" value="View detailed list" action="list_participant" /></span>
            </g:form>
          </div>
        </div>
       </g:if>
        </div>
    </body>
</html>
